package shujia.day19;

/*
函数型接口
    @FunctionalInterface
    public interface Function<T, R> {
         R apply(T t);
    }
 */

import java.util.function.Function;

class Test4 {
    public static void show1(String s, Function<String, Integer> function) {
        Integer i = function.apply(s);
        System.out.println(i);
    }
}

public class LambdaDemo4 {
    public static void main(String[] args) {
//        Test4.show1("hello", (String s)->{
//            return s.length();
//        });

        Test4.show1("hello", s -> s.length() + 1);

    }
}
